package alvarodelrosal.chat.client.chataction.local;

import java.util.ArrayList;
import java.util.List;

public class ChatLocalActionFactory {

    
    List<ChatLocalAction> actions = new ArrayList();

    public ChatLocalActionFactory() {
        addTheActions();
    }
    
    public ChatLocalAction getTheAction(String actionName) {
        for (ChatLocalAction action : actions) {
            if (action.getName().equals(actionName)) {
                return action;
            }
        }
        return new ChatOops();
    }

    private void addTheActions() {
        actions.add(new ChatAddToChat());
        actions.add(new ChatAllChats());
        actions.add(new ChatAllMyChats());
        actions.add(new ChatBye());
        actions.add(new ChatChat());
        actions.add(new ChatConversation());
        actions.add(new ChatErrorLogin());
        actions.add(new ChatGetAllUsers());
        actions.add(new ChatGetUserData());
        actions.add(new ChatInvitedToChat());
        actions.add(new ChatMyChats());
        actions.add(new ChatName());
        actions.add(new ChatNewChat());
        actions.add(new ChatNewUser());
        actions.add(new ChatOkLogin());
        actions.add(new ChatWhoIsIn());
    }
    
}
